Borland Online And The Cobb Group Present:


September, 1994 - Vol. 1 No. 9

Using TurboVision and the BIDS classes in the same project

I've been working on a TurboVision application in Borland C++ 3.1 using the DOS Integrated Development Environment (IDE), and I recently decided to use some of the BIDS classes in the same project. However, I've been getting an error message that reads

Undefined Symbol 'DEFAULT_ARRAY_SIZE'

To solve the problem, I defined this symbol with the line

const int DEFAULT_ARRAY_SIZE = 10;

I don't remember having to define this symbol for non-TurboVision applications. What am I doing wrong?

Bill Crosby

Panama City, Florida

You're not doing anything wrong, Bill. The problem you're seeing is a result of a naming conflict between the header files for TurboVision and the header files for the BIDS classes.

When you want to use the BIDS classes in a project, you'll need to add a #include statement for the appropriate header files. As you already know, to allow the compiler to find these header files, you need to select Directories... from the Options menu and then add the directory path for the BIDS header files to the compiler's Include Directories entry field, as shown in Figure A. (To avoid Linker errors, you'll also need to add the directory path for the BIDS library file in the Library Directories entry field.)


Figure A - You use the Directories dialog box to specify the default paths the compiler should search to find header files.

If the TurboVision include directory path appears before the one for the BIDS class libraries, as we've shown in Figure A, you'll have to explicitly add the #include directive

#include "\BORLANDC\CLASSLIB\INCLUDE\RESOURCE.H"

ahead of the #include statements for any of the BIDS header files. If you don't add this line, you'll see an error message like the one you've described, telling you to define one of the following constants:

DEFAULT_HASH_TABLE_SIZE
DEFAULT_BAG_SIZE
DEFAULT_SET_SIZE
DEFAULT_DEQUE_SIZE
DEFAULT_QUEUE_SIZE
DEFAULT_STACK_SIZE
DEFAULT_ARRAY_SIZE
DEFAULT_DICT_SIZE

If, on the other hand, the BIDS class library include path appears before the path for the TurboVision header files, the problem is more subtle. In this case, you won't see any problems until you try to create an instance of one of the following types, or until you try to derive a new type from one of them:

TStringCollection
TResourceItem
TResourceCollection
TResourceFile
TStrIndexRec
TStringList
TStrListMaker

If you try to use one of these types, the compiler will issue an Undefined Symbol error for that type.

In either case, #include statements that appear in other header files in the form

#include <resource.h>

use the first RESOURCE.H file the compiler finds­­based on the include paths you've specified. To avoid problems, you'll need to force the compiler to process both versions of the RESOURCE.H file.

In general, you should place the TurboVision include path before the BIDS class library include path. Then, add the explicit #include statement for the BIDS version of the RESOURCE.H file, specifying the full path as we've shown here.

Return to the Borland C++ Developer's Journal index

Subscribe to the Borland C++ Developer's Journal


Copyright (c) 1996 The Cobb Group, a division of Ziff-Davis Publishing Company. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff-Davis Publishing Company is prohibited. The Cobb Group and The Cobb Group logo are trademarks of Ziff-Davis Publishing Company.